﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Commerce.Contracts;

namespace MusicWorks.Service.DataContracts
{
    public class LineItem : BaseCommerceEntity
    {
        public const string ModelNameDefinition = "LineItem";

        public LineItem()
        {
            CommerceEntity = new CommerceEntity(ModelNameDefinition);
        }

        public LineItem(CommerceEntity commerceEntity) : base(commerceEntity)
        {
            CommerceEntity = commerceEntity;
        }


        public String CatalogName
        {
            get { return _commerceEntity.GetPropertyValue(PropertyName.CatalogName) as string; }
            set { _commerceEntity.SetPropertyValue(PropertyName.CatalogName, value);}
        }

        public String ProductId
        {
            get { return _commerceEntity.GetPropertyValue(PropertyName.ProductId) as string; }
            set { _commerceEntity.SetPropertyValue(PropertyName.ProductId, value);}
        }

        public String VariantId
        {
            get { return _commerceEntity.GetPropertyValue(PropertyName.VariantId) as string; }
            set { _commerceEntity.SetPropertyValue(PropertyName.VariantId, value);}
        }

        public int Quantity
        {
            get { return (int) _commerceEntity.GetPropertyValue(PropertyName.Quantity); }
            set { _commerceEntity.SetPropertyValue(PropertyName.Quantity, value);}
        }


        /// <summary>
        /// Names of the properties exposed by this commerce entity.
        /// </summary>
        public class PropertyName : CommerceEntity.PropertyName
        {
            #region Constants

            /// <summary>
            /// The name of the BasketLevelDiscountAmount property for a LineItem.
            /// </summary>
            public const string BasketLevelDiscountAmount = "BasketLevelDiscountAmount";

            /// <summary>
            /// The name of the CatalogName property for a LineItem.
            /// </summary>
            public const string CatalogName = "CatalogName";

            /// <summary>
            /// The name of the BaseCatalogName property for a LineItem.
            /// </summary>
            public const string BaseCatalogName = "BaseCatalogName";

            /// <summary>
            /// The name of the DisplayName property for a LineItem.
            /// </summary>
            public const string DisplayName = "DisplayName";

            /// <summary>
            /// The name of the GiftMessage property for a LineItem.
            /// </summary>
            public const string GiftMessage = "GiftMessage";

            /// <summary>
            /// The name of the GiftWrap property for a LineItem.
            /// </summary>
            public const string GiftWrap = "GiftWrap";

            /// <summary>
            /// The name of the InStockQuantity property for a LineItem.
            /// </summary>
            public const string InStockQuantity = "InStockQuantity";

            /// <summary>
            /// The name of the InventoryCondition property for a LineItem.
            /// </summary>
            public const string InventoryCondition = "InventoryCondition";

            /// <summary>
            /// The name of the ItemLevelDiscountAmount property for a LineItem.
            /// </summary>
            public const string ItemLevelDiscountAmount = "ItemLevelDiscountAmount";

            /// <summary>
            /// The name of the ItemPriority property for a LineItem.
            /// </summary>
            public const string ItemPriority = "ItemPriority";

            /// <summary>
            /// The name of the ListPrice property for a LineItem.
            /// </summary>
            public const string ListPrice = "ListPrice";

            /// <summary>
            /// The name of the PlacedPrice property for a LineItem.
            /// </summary>
            public const string PlacedPrice = "PlacedPrice";

            /// <summary>
            /// The name of the ProductId property for a LineItem.
            /// </summary>
            public const string ProductId = "ProductId";

            /// <summary>
            /// The name of the Quantity property for a LineItem.
            /// </summary>
            public const string Quantity = "Quantity";

            /// <summary>
            /// The name of the ShippingAddressId property for a LineItem.
            /// </summary>
            public const string ShippingAddressId = "ShippingAddressId";

            /// <summary>
            /// The name of the ShippingMethodId property for a LineItem.
            /// </summary>
            public const string ShippingMethodId = "ShippingMethodId";

            /// <summary>
            /// The name of the Status property for a LineItem.
            /// </summary>
            public const string Status = "Status";

            /// <summary>
            /// The name of the Total property for a LineItem.
            /// </summary>
            public const string Total = "Total";

            /// <summary>
            /// The name of the VariantId property for a LineItem.
            /// </summary>
            public const string VariantId = "VariantId";

            #endregion
        }

        /// <summary>
        /// Class defining Properties of Items that may be related to a LineItem
        /// </summary>
        public class RelationshipName
        {
            /// <summary>
            /// The name of the BasketLevelDiscounts property for an item related to a LineItem.
            /// </summary>
            public const string BasketLevelDiscounts = "BasketLevelDiscounts";

            /// <summary>
            /// The name of the ItemLevelDiscounts property for an item related to a LineItem.
            /// </summary>
            public const string ItemLevelDiscounts = "ItemLevelDiscounts";

        }

  

    }
}
